const path = require('path');

function resolve(dir) {
	return path.join(__dirname, dir);
}

module.exports = {
  lintOnSave: false,
  configureWebpack: {
    resolve: {
      alias: {
        'assets': '@/assets',
        'common': '@/common',
        'components': '@/components',
        'directive': '@/directive',
        'router': '@/router',
        'network': '@/network',
        'store': '@/store',
        'styles': '@/styles',
        'utils': '@/utils',
        'views': '@/views'
      }
    }
  },
  chainWebpack: (config) => {
		config.module
      .rule('svg')
      .exclude.add(resolve('src/icons'))
      .end()
    config.module
      .rule('icons')
      .test(/\.svg$/)
      .include.add(resolve('src/icons'))
      .end()
      .use('svg-sprite-loader')
      .loader('svg-sprite-loader')
      .options({
        symbolId: 'icon-[name]'
      })
      .end()
	}
};




// module.exports = {
// 	lintOnSave: false,
// 	chainWebpack: (config) => {
// 		config.resolve.alias
// 			.set('@', resolve('src'))
// 			.set('@assets',resolve('src/assets'))
// 			.set('@components',resolve('src/components'))
// 		// 这里只写了两个个，你可以自己再加，按这种格式.set('', resolve(''))
// 	}
// };
